package com.example.zookeeper.core;

import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.data.Stat;

import java.util.List;

public interface ZkCore
{
    void createNode(String path, byte[] data, CreateMode createMode) throws KeeperException, InterruptedException;

    void delete(String path) throws KeeperException, InterruptedException;

    byte[] getValue(String path) throws KeeperException, InterruptedException;

    byte[] getValue(String path, Watcher watcher) throws KeeperException, InterruptedException;

    void setValue(String path, byte[] data) throws KeeperException, InterruptedException;

    Stat exist(String path) throws KeeperException, InterruptedException;

    List<String> getChildNodes(String path, boolean watcher) throws KeeperException, InterruptedException;

    List<String> getChildNodes(String path, Watcher watcher) throws KeeperException, InterruptedException;

    void close() throws InterruptedException;
}
